import Loadable from 'react-loadable';
import MyLoadingComponent from "./MyLoadingComponent";
import RouteTab from "pages/index";
//******************维护路径**********************/
import About from 'pages/hospital/about';//静态导入
import Home from 'pages/hospital/home';//静态导入

//异步加载组件
const AsyncHome = Loadable({
    loader: () => import('pages/hospital/home'),
    loading: MyLoadingComponent
});

const AsyncAbout = Loadable({
    loader: () => import('pages/hospital/about'),
    loading: MyLoadingComponent
});

//tabs
const pagingTabs = [
    {
        name: '就诊服务',
        path: '/service',
        component: RouteTab
    },
    {
        name: '个人中心',
        path: '/center',
        component: RouteTab
    },
    {
        name: '医院信息',
        path: '/hospital',
        component: RouteTab
    },
]

const Routes = [
    ...pagingTabs,
    {
        name: '首页',
        path: '/home',
        component: AsyncHome
    },
    {
        name: '关于',
        path: '/about',
        component: AsyncAbout
    }
]
export default Routes